home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-15 | 855 b | 43 lines | [TEXT/PJMM] |
- unit stars;
-
- interface
- uses
- {$IFC UNDEFINED THINK_PASCAL}
- Types, QuickDraw, Events, Menus, Dialogs, Fonts, Resources, Devices,
- {$ENDC}
- Globals, Util;
-
- procedure InitStars;
- procedure DrawStars;
-
- implementation
-
- procedure InitStars;
- var
- i: Integer;
- begin
- for i := 0 to MAX_STARS - 1 do
- begin
- gStarRecs[i].where.v := RngRnd(0, 479);
- gStarRecs[i].where.h := RngRnd(0, 639);
- gStarRecs[i].color.red := -1;
- gStarRecs[i].color.green := -1;
- gStarRecs[i].color.blue := -1;
- end; (* for *)
- end; (* InitStars() *)
-
- procedure DrawStars;
- var
- i: Integer;
- savePort: GrafPtr;
- begin
- GetPort(savePort);
- SetPort(GrafPtr(gOSPtr));
- for i := 0 to MAX_STARS - 1 do
- begin
- SetCPixel(gStarRecs[i].where.h, gStarRecs[i].where.v, gStarRecs[i].color);
- end; (* for *)
- SetPort(savePort);
- end; (* DrawStars() *)
-
- end.